{# vim: set et ts=8 sts=4 sw=4 ai: #}
{% extends "page.html" %}
{%block head %}
{{ super() }}
<meta name="robots" content="noindex, nofollow">
{% endblock %}
{% block extra_nav %}{% endblock %}
{% block content %}
<div class="w-full mw-full p-0 clearfix">
    <h2>History {#{pagename}#}</h2>
{# pagination #}
{#
<nav aria-label="Pagination" class="float-right">
<div class="btn-group" role="group">
  <!-- Previous page -->
  <a class="btn btn-square" href="#">
    <i class="fa fa-angle-left" aria-hidden="true"></i>
    <span class="sr-only">Previous page</span> <!-- sr-only = only for screen readers -->
  </a>
  <!-- Pages -->
  <a class="btn btn-square active" href="#">1</a>
  <a class="btn btn-square" href="#">2</a>
  <a class="btn btn-square" href="#">3</a>
  <a class="btn btn-square" href="#">4</a>
  <a class="btn btn-square" href="#">5</a>
  <!-- Next page -->
  <a class="btn btn-square" href="#">
    <i class="fa fa-angle-right" aria-hidden="true"></i>
    <span class="sr-only">Next page</span> <!-- sr-only = only for screen readers -->
  </a>
</div>
</nav>
#}
</div>
{# log #}
<div class="w-full mw-full">
  <form action="{{ url_for('history', path=pagepath) }}" method="post">
  <button type="submit" class="btn btn-primary">Compare Revisions</button>
</div>
<div class="w-full mw-full my-15">
    <div class="table-responsive table-striped">
      <table class="table">
        <thead>
          <tr>
            <td></td>
            <td></td>
            <th>Date</th>
            <th>Author</th>
            <th class="w-half">Commit Message</th>
          </tr>
        </thead>
        <tbody>
{% for entry in log %}
          <tr class="align-top">
            <td style="width:1%;padding:1.2rem 0.5rem;">
              <div class="custom-radio">
                <input type="radio" id="radio-a-{{entry.revision}}" name="rev_a" value="{{entry.revision}}" {% if entry.revision == rev_a %}checked{%endif%}>
                <label for="radio-a-{{entry.revision}}"></label>
              </div>
            </td>
            <td style="width:1%;padding:1.2rem 0.5rem;">
              <div class="custom-radio">
                <input type="radio" id="radio-b-{{entry.revision}}" name="rev_b" value="{{entry.revision}}" {% if entry.revision == rev_b %}checked{%endif%}>
                <label for="radio-b-{{entry.revision}}"></label>
              </div>
            </td>
            <td class="font-size-12 min text-nowrap"><a href="{{entry.url}}"><span class="datetime" title="{{entry.datetime|format_datetime("deltanow")}} ago">{{entry.datetime|format_datetime}}</span></a> <a a href="{{ url_for("show_commit", revision=entry.revision) }}" title="{{entry.url}}" class="btn revision-small">{{entry.revision}}</a>{% if has_permission('WRITE') %}<a href="{{ url_for("revert", revision=entry.revision) }}"> <i class="fas fa-undo" alt="revert" title="revert commit {{entry.revision}}"></i></a>{% endif %}
</td>
{# author #}
            <td class="min" style="white-space:nowrap">{%if not entry.author_email%}{{entry.author_name}}{%else%}<a href="mailto:{{entry.author_email}}">{{entry.author_name}}</a>{%endif%}</td>
{# files #}
            <td class="text-wrap">{{entry.message or '-/-'|safe}}</td>
          </tr>
{% endfor %}
        </tbody>
      </table>
    </div>
</div>
<div class="w-full mw-full my-15">
  <button type="submit" class="btn btn-primary">Compare Revisions</button>
</div>
</form>
{% endblock %}
